{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "joined-listing",
   "metadata": {},
   "source": [
    "作业：\n",
    "\n",
    "1.随机数生成六个班的考试成绩，3门考试：Python、数学、语文。每个班50人\n",
    "\n",
    "2.将六个班的考试成绩进行合并得到score\n",
    "\n",
    "3.生成性别数组sex，水平叠加数组sex和score得到data\n",
    "\n",
    "4.分别计算男女生各科成绩统计指标：最小值、最大值、平均分、中位数、标准差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "interim-projection",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[18, 78, 59],\n",
       "       [ 7, 82, 68],\n",
       "       [ 0, 65, 15],\n",
       "       [71, 28, 57],\n",
       "       [65, 34, 95],\n",
       "       [40, 83, 86],\n",
       "       [13, 38, 83],\n",
       "       [23, 15, 85],\n",
       "       [15, 73, 20],\n",
       "       [18,  1, 38],\n",
       "       [71, 27, 98],\n",
       "       [62, 62,  2],\n",
       "       [69, 21, 26],\n",
       "       [ 2,  3, 72],\n",
       "       [30, 93, 37],\n",
       "       [63, 20, 88],\n",
       "       [92, 65, 39],\n",
       "       [92, 37, 81],\n",
       "       [37, 51, 14],\n",
       "       [72, 23, 48],\n",
       "       [97, 20, 77],\n",
       "       [37, 72, 89],\n",
       "       [57, 48, 84],\n",
       "       [51, 82, 16],\n",
       "       [21, 28, 37],\n",
       "       [81, 66, 35],\n",
       "       [57, 55, 23],\n",
       "       [77, 85, 74],\n",
       "       [66, 81, 22],\n",
       "       [ 7, 12, 80],\n",
       "       [27, 26, 99],\n",
       "       [86, 88, 15],\n",
       "       [94,  0, 87],\n",
       "       [69,  8, 10],\n",
       "       [ 6, 43, 59],\n",
       "       [17, 17, 85],\n",
       "       [24, 73, 89],\n",
       "       [73, 58, 28],\n",
       "       [22, 19, 10],\n",
       "       [92, 90, 62],\n",
       "       [98, 17, 34],\n",
       "       [13,  7, 13],\n",
       "       [19, 25, 90],\n",
       "       [18, 80, 93],\n",
       "       [75, 55, 95],\n",
       "       [51,  1, 96],\n",
       "       [78, 67, 38],\n",
       "       [ 1, 81, 35],\n",
       "       [43, 90, 38],\n",
       "       [16, 97, 46]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[65, 19, 16],\n",
       "       [37, 61, 78],\n",
       "       [69, 82, 76],\n",
       "       [49, 20, 56],\n",
       "       [31, 31, 38],\n",
       "       [61,  1, 16],\n",
       "       [15, 52, 12],\n",
       "       [14, 57, 88],\n",
       "       [69, 23, 36],\n",
       "       [ 0, 77, 67],\n",
       "       [51, 43, 44],\n",
       "       [35, 31, 84],\n",
       "       [60, 48, 89],\n",
       "       [51, 85, 70],\n",
       "       [ 8,  2, 53],\n",
       "       [40, 20,  9],\n",
       "       [12, 66, 95],\n",
       "       [86, 53, 38],\n",
       "       [24, 33, 64],\n",
       "       [37, 27,  9],\n",
       "       [70, 36, 74],\n",
       "       [ 1, 69, 87],\n",
       "       [68, 24, 91],\n",
       "       [41, 81, 31],\n",
       "       [52, 69,  1],\n",
       "       [16, 90, 46],\n",
       "       [68, 49, 38],\n",
       "       [71, 81, 70],\n",
       "       [96, 75, 86],\n",
       "       [22, 80, 55],\n",
       "       [47, 11, 61],\n",
       "       [ 4,  9, 62],\n",
       "       [55, 89, 55],\n",
       "       [31, 94, 16],\n",
       "       [81, 17, 95],\n",
       "       [ 1,  4, 70],\n",
       "       [76, 56,  5],\n",
       "       [78, 78, 30],\n",
       "       [ 6,  7, 63],\n",
       "       [ 8, 97, 70],\n",
       "       [61, 69, 50],\n",
       "       [78, 86, 63],\n",
       "       [16, 60, 60],\n",
       "       [92, 60, 87],\n",
       "       [93, 48, 75],\n",
       "       [39, 44, 42],\n",
       "       [ 0, 87,  0],\n",
       "       [97, 83, 22],\n",
       "       [13,  0, 10],\n",
       "       [30, 54, 73]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[84, 96, 84],\n",
       "       [94, 18, 65],\n",
       "       [69, 42, 66],\n",
       "       [97, 22, 26],\n",
       "       [94, 80, 68],\n",
       "       [22, 33, 20],\n",
       "       [80, 24, 29],\n",
       "       [ 8, 50, 45],\n",
       "       [75, 47, 33],\n",
       "       [41,  1, 17],\n",
       "       [48, 86,  3],\n",
       "       [56, 76, 21],\n",
       "       [78,  9, 58],\n",
       "       [91, 91, 20],\n",
       "       [88, 13, 65],\n",
       "       [47, 82, 48],\n",
       "       [43, 91, 48],\n",
       "       [35, 19, 98],\n",
       "       [ 6, 33,  6],\n",
       "       [65, 70, 57],\n",
       "       [43, 50, 69],\n",
       "       [61, 36, 18],\n",
       "       [19,  2, 38],\n",
       "       [51,  4, 67],\n",
       "       [69, 11,  7],\n",
       "       [81, 38, 55],\n",
       "       [49,  5, 73],\n",
       "       [60,  7,  8],\n",
       "       [28, 93, 27],\n",
       "       [22, 20, 70],\n",
       "       [97, 96, 10],\n",
       "       [59, 72, 48],\n",
       "       [54, 62, 84],\n",
       "       [59, 62, 40],\n",
       "       [29, 24, 61],\n",
       "       [ 2, 53, 11],\n",
       "       [50, 27, 83],\n",
       "       [96, 87, 42],\n",
       "       [46, 56, 30],\n",
       "       [38, 91, 97],\n",
       "       [39, 54,  9],\n",
       "       [75, 20, 20],\n",
       "       [92, 60, 89],\n",
       "       [44, 27, 10],\n",
       "       [89, 45,  2],\n",
       "       [ 8, 48,  0],\n",
       "       [69, 51, 35],\n",
       "       [10,  3, 58],\n",
       "       [58, 68, 25],\n",
       "       [63, 82, 62]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[83, 38, 91],\n",
       "       [27, 25, 96],\n",
       "       [74, 48, 13],\n",
       "       [73, 73,  1],\n",
       "       [81, 27, 81],\n",
       "       [90, 41, 73],\n",
       "       [10,  5, 66],\n",
       "       [91,  1, 86],\n",
       "       [18, 97, 33],\n",
       "       [56, 93, 98],\n",
       "       [99, 18, 22],\n",
       "       [94, 96, 78],\n",
       "       [ 7, 54, 46],\n",
       "       [17, 74,  2],\n",
       "       [87, 98, 69],\n",
       "       [73, 12, 94],\n",
       "       [93, 64, 56],\n",
       "       [89, 30, 18],\n",
       "       [76, 19, 96],\n",
       "       [57, 83, 78],\n",
       "       [45, 23, 16],\n",
       "       [89, 62,  0],\n",
       "       [19, 83, 48],\n",
       "       [72, 84, 73],\n",
       "       [74,  3, 45],\n",
       "       [79, 70, 77],\n",
       "       [38, 16, 81],\n",
       "       [47, 32, 54],\n",
       "       [39, 70,  4],\n",
       "       [59, 96, 93],\n",
       "       [81, 33, 89],\n",
       "       [ 4, 79, 96],\n",
       "       [64, 46, 92],\n",
       "       [ 0, 61, 83],\n",
       "       [10, 59,  3],\n",
       "       [ 1, 15, 43],\n",
       "       [80, 79,  8],\n",
       "       [86, 94, 81],\n",
       "       [83, 56, 84],\n",
       "       [93, 91, 19],\n",
       "       [ 3, 82,  2],\n",
       "       [75, 62, 31],\n",
       "       [51, 61, 73],\n",
       "       [88, 88, 89],\n",
       "       [82, 93, 10],\n",
       "       [19, 28, 38],\n",
       "       [ 4, 74, 26],\n",
       "       [74, 53, 29],\n",
       "       [34, 78, 32],\n",
       "       [82, 42, 66]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[68, 85, 70],\n",
       "       [64, 62, 24],\n",
       "       [23, 92,  2],\n",
       "       [10, 92,  4],\n",
       "       [99, 24, 37],\n",
       "       [37, 71, 38],\n",
       "       [21, 16, 36],\n",
       "       [38, 42, 81],\n",
       "       [55, 99, 75],\n",
       "       [65, 75,  8],\n",
       "       [77, 49, 34],\n",
       "       [11, 64, 73],\n",
       "       [70, 31, 67],\n",
       "       [34, 52, 29],\n",
       "       [86, 93, 42],\n",
       "       [44, 29, 28],\n",
       "       [79, 48, 88],\n",
       "       [79, 34, 30],\n",
       "       [89, 25, 71],\n",
       "       [13, 98, 72],\n",
       "       [56, 24, 83],\n",
       "       [91,  3,  7],\n",
       "       [86, 16, 60],\n",
       "       [67, 33, 20],\n",
       "       [40, 70, 93],\n",
       "       [99, 25, 81],\n",
       "       [66,  7, 48],\n",
       "       [18, 90, 91],\n",
       "       [ 0, 22, 42],\n",
       "       [40, 30,  1],\n",
       "       [ 2, 57, 87],\n",
       "       [49, 31, 76],\n",
       "       [73, 38,  9],\n",
       "       [84, 93, 80],\n",
       "       [26, 53, 21],\n",
       "       [17, 33, 20],\n",
       "       [32, 59, 65],\n",
       "       [22, 49, 97],\n",
       "       [44, 60, 70],\n",
       "       [ 9, 29, 86],\n",
       "       [53, 73, 75],\n",
       "       [84, 15, 84],\n",
       "       [60, 13, 93],\n",
       "       [ 9, 94, 61],\n",
       "       [43, 25,  8],\n",
       "       [50, 85, 80],\n",
       "       [71,  5, 42],\n",
       "       [ 5, 12, 94],\n",
       "       [33, 98, 79],\n",
       "       [ 2, 90,  2]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[37, 18, 10],\n",
       "       [79, 76, 25],\n",
       "       [23, 54,  7],\n",
       "       [81, 67, 21],\n",
       "       [ 6,  8, 99],\n",
       "       [94, 97, 76],\n",
       "       [41, 21, 82],\n",
       "       [81, 46, 35],\n",
       "       [60,  5, 88],\n",
       "       [ 3, 44, 95],\n",
       "       [ 9, 38, 32],\n",
       "       [62, 41, 74],\n",
       "       [74, 54, 28],\n",
       "       [77, 80, 15],\n",
       "       [48, 74,  8],\n",
       "       [48, 18, 46],\n",
       "       [61, 23, 53],\n",
       "       [16, 81, 53],\n",
       "       [66,  2, 93],\n",
       "       [54, 97, 99],\n",
       "       [78, 95, 46],\n",
       "       [44, 47, 63],\n",
       "       [ 2, 54, 89],\n",
       "       [ 9, 44, 47],\n",
       "       [99, 12, 57],\n",
       "       [47, 93, 68],\n",
       "       [43, 56, 46],\n",
       "       [82,  6, 11],\n",
       "       [10, 31, 54],\n",
       "       [47, 89, 41],\n",
       "       [48, 55, 79],\n",
       "       [75, 50, 51],\n",
       "       [38, 80, 23],\n",
       "       [77, 90, 34],\n",
       "       [74, 42, 67],\n",
       "       [84, 41,  1],\n",
       "       [21, 62, 78],\n",
       "       [33, 97, 86],\n",
       "       [34, 28, 21],\n",
       "       [74,  4, 33],\n",
       "       [22, 67,  0],\n",
       "       [59, 91, 84],\n",
       "       [73, 96, 82],\n",
       "       [60,  0, 40],\n",
       "       [81,  6,  7],\n",
       "       [42, 69, 10],\n",
       "       [52, 47, 53],\n",
       "       [25, 13, 28],\n",
       "       [64,  3, 36],\n",
       "       [91, 50, 27]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 生成6个班的考试乘成绩\n",
    "import numpy as np\n",
    "\n",
    "Grade1 = np.random.randint(0,100,size = (50,3))\n",
    "Grade2 = np.random.randint(0,100,size = (50,3))\n",
    "Grade3 = np.random.randint(0,100,size = (50,3))\n",
    "Grade4 = np.random.randint(0,100,size = (50,3))\n",
    "Grade5 = np.random.randint(0,100,size = (50,3))\n",
    "Grade6 = np.random.randint(0,100,size = (50,3))\n",
    "display(Grade1,Grade2,Grade3,Grade4,Grade5,Grade6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "suitable-sponsorship",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[18, 78, 59],\n",
       "       [ 7, 82, 68],\n",
       "       [ 0, 65, 15],\n",
       "       [71, 28, 57],\n",
       "       [65, 34, 95],\n",
       "       [40, 83, 86],\n",
       "       [13, 38, 83],\n",
       "       [23, 15, 85],\n",
       "       [15, 73, 20],\n",
       "       [18,  1, 38],\n",
       "       [71, 27, 98],\n",
       "       [62, 62,  2],\n",
       "       [69, 21, 26],\n",
       "       [ 2,  3, 72],\n",
       "       [30, 93, 37],\n",
       "       [63, 20, 88],\n",
       "       [92, 65, 39],\n",
       "       [92, 37, 81],\n",
       "       [37, 51, 14],\n",
       "       [72, 23, 48],\n",
       "       [97, 20, 77],\n",
       "       [37, 72, 89],\n",
       "       [57, 48, 84],\n",
       "       [51, 82, 16],\n",
       "       [21, 28, 37],\n",
       "       [81, 66, 35],\n",
       "       [57, 55, 23],\n",
       "       [77, 85, 74],\n",
       "       [66, 81, 22],\n",
       "       [ 7, 12, 80],\n",
       "       [27, 26, 99],\n",
       "       [86, 88, 15],\n",
       "       [94,  0, 87],\n",
       "       [69,  8, 10],\n",
       "       [ 6, 43, 59],\n",
       "       [17, 17, 85],\n",
       "       [24, 73, 89],\n",
       "       [73, 58, 28],\n",
       "       [22, 19, 10],\n",
       "       [92, 90, 62],\n",
       "       [98, 17, 34],\n",
       "       [13,  7, 13],\n",
       "       [19, 25, 90],\n",
       "       [18, 80, 93],\n",
       "       [75, 55, 95],\n",
       "       [51,  1, 96],\n",
       "       [78, 67, 38],\n",
       "       [ 1, 81, 35],\n",
       "       [43, 90, 38],\n",
       "       [16, 97, 46],\n",
       "       [65, 19, 16],\n",
       "       [37, 61, 78],\n",
       "       [69, 82, 76],\n",
       "       [49, 20, 56],\n",
       "       [31, 31, 38],\n",
       "       [61,  1, 16],\n",
       "       [15, 52, 12],\n",
       "       [14, 57, 88],\n",
       "       [69, 23, 36],\n",
       "       [ 0, 77, 67],\n",
       "       [51, 43, 44],\n",
       "       [35, 31, 84],\n",
       "       [60, 48, 89],\n",
       "       [51, 85, 70],\n",
       "       [ 8,  2, 53],\n",
       "       [40, 20,  9],\n",
       "       [12, 66, 95],\n",
       "       [86, 53, 38],\n",
       "       [24, 33, 64],\n",
       "       [37, 27,  9],\n",
       "       [70, 36, 74],\n",
       "       [ 1, 69, 87],\n",
       "       [68, 24, 91],\n",
       "       [41, 81, 31],\n",
       "       [52, 69,  1],\n",
       "       [16, 90, 46],\n",
       "       [68, 49, 38],\n",
       "       [71, 81, 70],\n",
       "       [96, 75, 86],\n",
       "       [22, 80, 55],\n",
       "       [47, 11, 61],\n",
       "       [ 4,  9, 62],\n",
       "       [55, 89, 55],\n",
       "       [31, 94, 16],\n",
       "       [81, 17, 95],\n",
       "       [ 1,  4, 70],\n",
       "       [76, 56,  5],\n",
       "       [78, 78, 30],\n",
       "       [ 6,  7, 63],\n",
       "       [ 8, 97, 70],\n",
       "       [61, 69, 50],\n",
       "       [78, 86, 63],\n",
       "       [16, 60, 60],\n",
       "       [92, 60, 87],\n",
       "       [93, 48, 75],\n",
       "       [39, 44, 42],\n",
       "       [ 0, 87,  0],\n",
       "       [97, 83, 22],\n",
       "       [13,  0, 10],\n",
       "       [30, 54, 73],\n",
       "       [84, 96, 84],\n",
       "       [94, 18, 65],\n",
       "       [69, 42, 66],\n",
       "       [97, 22, 26],\n",
       "       [94, 80, 68],\n",
       "       [22, 33, 20],\n",
       "       [80, 24, 29],\n",
       "       [ 8, 50, 45],\n",
       "       [75, 47, 33],\n",
       "       [41,  1, 17],\n",
       "       [48, 86,  3],\n",
       "       [56, 76, 21],\n",
       "       [78,  9, 58],\n",
       "       [91, 91, 20],\n",
       "       [88, 13, 65],\n",
       "       [47, 82, 48],\n",
       "       [43, 91, 48],\n",
       "       [35, 19, 98],\n",
       "       [ 6, 33,  6],\n",
       "       [65, 70, 57],\n",
       "       [43, 50, 69],\n",
       "       [61, 36, 18],\n",
       "       [19,  2, 38],\n",
       "       [51,  4, 67],\n",
       "       [69, 11,  7],\n",
       "       [81, 38, 55],\n",
       "       [49,  5, 73],\n",
       "       [60,  7,  8],\n",
       "       [28, 93, 27],\n",
       "       [22, 20, 70],\n",
       "       [97, 96, 10],\n",
       "       [59, 72, 48],\n",
       "       [54, 62, 84],\n",
       "       [59, 62, 40],\n",
       "       [29, 24, 61],\n",
       "       [ 2, 53, 11],\n",
       "       [50, 27, 83],\n",
       "       [96, 87, 42],\n",
       "       [46, 56, 30],\n",
       "       [38, 91, 97],\n",
       "       [39, 54,  9],\n",
       "       [75, 20, 20],\n",
       "       [92, 60, 89],\n",
       "       [44, 27, 10],\n",
       "       [89, 45,  2],\n",
       "       [ 8, 48,  0],\n",
       "       [69, 51, 35],\n",
       "       [10,  3, 58],\n",
       "       [58, 68, 25],\n",
       "       [63, 82, 62],\n",
       "       [83, 38, 91],\n",
       "       [27, 25, 96],\n",
       "       [74, 48, 13],\n",
       "       [73, 73,  1],\n",
       "       [81, 27, 81],\n",
       "       [90, 41, 73],\n",
       "       [10,  5, 66],\n",
       "       [91,  1, 86],\n",
       "       [18, 97, 33],\n",
       "       [56, 93, 98],\n",
       "       [99, 18, 22],\n",
       "       [94, 96, 78],\n",
       "       [ 7, 54, 46],\n",
       "       [17, 74,  2],\n",
       "       [87, 98, 69],\n",
       "       [73, 12, 94],\n",
       "       [93, 64, 56],\n",
       "       [89, 30, 18],\n",
       "       [76, 19, 96],\n",
       "       [57, 83, 78],\n",
       "       [45, 23, 16],\n",
       "       [89, 62,  0],\n",
       "       [19, 83, 48],\n",
       "       [72, 84, 73],\n",
       "       [74,  3, 45],\n",
       "       [79, 70, 77],\n",
       "       [38, 16, 81],\n",
       "       [47, 32, 54],\n",
       "       [39, 70,  4],\n",
       "       [59, 96, 93],\n",
       "       [81, 33, 89],\n",
       "       [ 4, 79, 96],\n",
       "       [64, 46, 92],\n",
       "       [ 0, 61, 83],\n",
       "       [10, 59,  3],\n",
       "       [ 1, 15, 43],\n",
       "       [80, 79,  8],\n",
       "       [86, 94, 81],\n",
       "       [83, 56, 84],\n",
       "       [93, 91, 19],\n",
       "       [ 3, 82,  2],\n",
       "       [75, 62, 31],\n",
       "       [51, 61, 73],\n",
       "       [88, 88, 89],\n",
       "       [82, 93, 10],\n",
       "       [19, 28, 38],\n",
       "       [ 4, 74, 26],\n",
       "       [74, 53, 29],\n",
       "       [34, 78, 32],\n",
       "       [82, 42, 66],\n",
       "       [68, 85, 70],\n",
       "       [64, 62, 24],\n",
       "       [23, 92,  2],\n",
       "       [10, 92,  4],\n",
       "       [99, 24, 37],\n",
       "       [37, 71, 38],\n",
       "       [21, 16, 36],\n",
       "       [38, 42, 81],\n",
       "       [55, 99, 75],\n",
       "       [65, 75,  8],\n",
       "       [77, 49, 34],\n",
       "       [11, 64, 73],\n",
       "       [70, 31, 67],\n",
       "       [34, 52, 29],\n",
       "       [86, 93, 42],\n",
       "       [44, 29, 28],\n",
       "       [79, 48, 88],\n",
       "       [79, 34, 30],\n",
       "       [89, 25, 71],\n",
       "       [13, 98, 72],\n",
       "       [56, 24, 83],\n",
       "       [91,  3,  7],\n",
       "       [86, 16, 60],\n",
       "       [67, 33, 20],\n",
       "       [40, 70, 93],\n",
       "       [99, 25, 81],\n",
       "       [66,  7, 48],\n",
       "       [18, 90, 91],\n",
       "       [ 0, 22, 42],\n",
       "       [40, 30,  1],\n",
       "       [ 2, 57, 87],\n",
       "       [49, 31, 76],\n",
       "       [73, 38,  9],\n",
       "       [84, 93, 80],\n",
       "       [26, 53, 21],\n",
       "       [17, 33, 20],\n",
       "       [32, 59, 65],\n",
       "       [22, 49, 97],\n",
       "       [44, 60, 70],\n",
       "       [ 9, 29, 86],\n",
       "       [53, 73, 75],\n",
       "       [84, 15, 84],\n",
       "       [60, 13, 93],\n",
       "       [ 9, 94, 61],\n",
       "       [43, 25,  8],\n",
       "       [50, 85, 80],\n",
       "       [71,  5, 42],\n",
       "       [ 5, 12, 94],\n",
       "       [33, 98, 79],\n",
       "       [ 2, 90,  2],\n",
       "       [37, 18, 10],\n",
       "       [79, 76, 25],\n",
       "       [23, 54,  7],\n",
       "       [81, 67, 21],\n",
       "       [ 6,  8, 99],\n",
       "       [94, 97, 76],\n",
       "       [41, 21, 82],\n",
       "       [81, 46, 35],\n",
       "       [60,  5, 88],\n",
       "       [ 3, 44, 95],\n",
       "       [ 9, 38, 32],\n",
       "       [62, 41, 74],\n",
       "       [74, 54, 28],\n",
       "       [77, 80, 15],\n",
       "       [48, 74,  8],\n",
       "       [48, 18, 46],\n",
       "       [61, 23, 53],\n",
       "       [16, 81, 53],\n",
       "       [66,  2, 93],\n",
       "       [54, 97, 99],\n",
       "       [78, 95, 46],\n",
       "       [44, 47, 63],\n",
       "       [ 2, 54, 89],\n",
       "       [ 9, 44, 47],\n",
       "       [99, 12, 57],\n",
       "       [47, 93, 68],\n",
       "       [43, 56, 46],\n",
       "       [82,  6, 11],\n",
       "       [10, 31, 54],\n",
       "       [47, 89, 41],\n",
       "       [48, 55, 79],\n",
       "       [75, 50, 51],\n",
       "       [38, 80, 23],\n",
       "       [77, 90, 34],\n",
       "       [74, 42, 67],\n",
       "       [84, 41,  1],\n",
       "       [21, 62, 78],\n",
       "       [33, 97, 86],\n",
       "       [34, 28, 21],\n",
       "       [74,  4, 33],\n",
       "       [22, 67,  0],\n",
       "       [59, 91, 84],\n",
       "       [73, 96, 82],\n",
       "       [60,  0, 40],\n",
       "       [81,  6,  7],\n",
       "       [42, 69, 10],\n",
       "       [52, 47, 53],\n",
       "       [25, 13, 28],\n",
       "       [64,  3, 36],\n",
       "       [91, 50, 27]])"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 成绩合并\n",
    "Grade = (Grade1,Grade2,Grade3,Grade4,Grade5,Grade6)\n",
    "Score = np.vstack(Grade)\n",
    "Score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "hindu-cotton",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1]])"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 0代表女生，1代表男生\n",
    "sex = np.random.randint(0,2,size = (300,1)) \n",
    "sex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "united-bible",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[18, 78, 59,  1],\n",
       "       [ 7, 82, 68,  1],\n",
       "       [ 0, 65, 15,  0],\n",
       "       ...,\n",
       "       [25, 13, 28,  1],\n",
       "       [64,  3, 36,  1],\n",
       "       [91, 50, 27,  1]])"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 合并得到data\n",
    "data = np.hstack((Score,sex))\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "cardiovascular-governor",
   "metadata": {},
   "outputs": [],
   "source": [
    "#拆分出男生、女生的数据\n",
    "cond0 = data[:,3] == 0\n",
    "cond1 = data[:,3] == 1\n",
    "\n",
    "data_w = data[cond0] #女生\n",
    "data_m = data[cond1] #男生"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "selective-compatibility",
   "metadata": {},
   "source": [
    "女生成绩详情"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "lucky-spokesman",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 0, 0])"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_w.min(axis = 0) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "constant-control",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([99, 99, 99,  0])"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_w.max(axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "robust-architect",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([48.58389262, 52.28187919, 50.97315436,  0.        ])"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_w.mean(axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "monetary-blade",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([47., 54., 53.,  0.])"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.median(data_w, axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "naval-leader",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([30.11880295, 31.66923868, 28.87067817,  0.        ])"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_w.std(axis = 0)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ultimate-event",
   "metadata": {},
   "source": [
    "男生成绩详情"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "bronze-amsterdam",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 1, 0, 1])"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_m.min(axis = 0) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "magnetic-emperor",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([99, 97, 99,  1])"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_m.max(axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "refined-relationship",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([52.78807947, 48.07284768, 50.81456954,  1.        ])"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_m.mean(axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "impressive-reservoir",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([57., 48., 48.,  1.])"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.median(data_m, axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "federal-insulin",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([28.29354389, 27.61972118, 31.18146078,  0.        ])"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_m.std(axis = 0)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.1"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
